#include "avatar_factory.h"

AvatarFactory* AvatarFactory::instance_ = nullptr;

AvatarFactory::AvatarFactory()
{

}

AvatarFactory *AvatarFactory::Instance()
{
    if(instance_ == nullptr)
    {
        QMutex mutex;
        mutex.lock();
        instance_ = new AvatarFactory();
    }
    return instance_;
}

Avatar *AvatarFactory::NewAvatar(const int &avatar_type)
{
    Avatar* avatar = new Avatar();
    switch(avatar_type)
    {
        case ENUM_CUSTOM:
        {

        }
        break;

        case ENUM_EVIL:
        {
            avatar->AddMovie("evil_happy", ":/img_res/evil_happy.gif");
            avatar->AddMovie("evil_angry", ":/img_res/evil_angry.gif");
        }
        break;

        case ENUM_ANGEL:
        {
            //avatar->AddMovie("", ":/img_res/.gif");
            //avatar->AddMovie("evil_angry", ":/img_res/.gif");
        }
        break;

        case ENUM_ACTOR:
        {
            //avatar->AddMovie("", ":/img_res/.gif");
            //avatar->AddMovie("", ":/img_res/.gif");
        }
        break;
    }
    return avatar;
}
